Generating Code with Polymorphic let: A Ballad of Value Restriction, Copying and Sharing
نویسنده
چکیده
Getting polymorphism and effects such as mutation to live together in the same language is a tale worth telling, under the recurring refrain of copying vs. sharing. We add new stanzas to the tale, about the ordeal to generate code with polymorphism and effects, and be sure it type-checks. Generating well-typed–by–construction polymorphic let-expressions is impossible in the Hindley-Milner type system: even the author believed that. The polymorphic-let generator turns out to exist. We present its derivation and the application for the lightweight implementation of quotation via a novel and unexpectedly simple source-to-source transformation to code-generating combinators. However, generating let-expressions with polymorphic functions demands more than even the relaxed value restriction can deliver. We need a new deal for let-polymorphism in ML. We conjecture the weaker restriction and implement it in a practically-useful code-generation library. Its formal justification is formulated as the research program.
منابع مشابه
Code-Copying in the Balochi Language of Sistan
This empirical study deals with language contact phenomena in Sistan. Code-copying is viewed as a strategy of linguistic behavior when a dominated language acquires new elements in lexicon, phonology, morphology, syntax, pragmatic organization, etc., which can be interpreted as copies of a dominating language. In this framework Persian is regarded as the model code which provides elements for b...
متن کاملP-244: Analysis of Genomic and Cell Free DNA of A let-7 microRNA Binding Site of KRAS Gene Polymorphisms in Endometriosis
Background: Endometriosis is one of the most common benign gynecological diseases which is characterized by endometriallike tissue growing outside the uterine cavity. Although the pathology of endometriosis remains unknown, the genetic predisposition plays an apparent role. Several genes have been contributed to endometriosis, but it seems KRAS has a crucial role, because its activation results...
متن کاملCharacterization of Pseudomonas aeruginosa in Burn Patients Using PCR- Restriction Frag-ment Length Polymorphism and Random Amplified Polymorphic DNA Analysis
One of the major opportunistic pathogens in patients with burn injuries is Pseudomonas aeruginosa, which causes severe infections in burned patients. The objective of the study was to examine the molecular epidemiology of P. aeruginosa colonization in the burn unit of Shahid Motahari Hospital in Tehran, Iran. Restriction fragment length polymorphism (RFLP) and random amplified polymorphic DNA (...
متن کاملDesign of Logic Network for Generating Sequency Ordered Hadamard Matrix H
A logic network to produce the sequency ordered Hadamard matrix H based on the property of gray code and orthogonal group codes is developed. The network uses a counter to generate Rademacher function such that the output of H will be in sequency. A general purpose shift register with output logic is used to establish a sequence of period P corresponding to a given value of order m of the Hadam...
متن کاملHosoya polynomials of random benzenoid chains
Let $G$ be a molecular graph with vertex set $V(G)$, $d_G(u, v)$ the topological distance between vertices $u$ and $v$ in $G$. The Hosoya polynomial $H(G, x)$ of $G$ is a polynomial $sumlimits_{{u, v}subseteq V(G)}x^{d_G(u, v)}$ in variable $x$. In this paper, we obtain an explicit analytical expression for the expected value of the Hosoya polynomial of a random benzenoid chain with $n$ hexagon...
متن کامل